<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Grid布局</title>
    <style>
        .parent {
            width: 400px;
            height: 400px;
            margin: 50px auto;
            background-color: cyan;

            display: grid;
            grid-template-rows: repeat(4, 1fr);
            grid-template-columns: repeat(4, 1fr);
        }

        .child {
            background-color: rgb(148, 235, 238);
        }

        .item01 {
            background-color: red;

            /* 默认网格线创建单元格 */

            /* 普通形式 */
            /* grid-row-start: 1;
            grid-row-end: 3;
            grid-column-start: 1;
            grid-column-end: 3; */

            /* 简写形式 */
            /* grid-row: 1/3;
            grid-column: 1/3; */

            /* 跨越形式 */
            /* grid-row-start: 1;
            grid-row-end: span 2;
            grid-column-start: 1;
            grid-column-end: span 2; */

            /* 简写+跨越形式 */
            grid-row: 1 / span 2;
            grid-column: 1 / span 2;

            /* 默认在【当前位置】上跨越 */
            /* grid-row: span 2;
            grid-column: span 2; */
        }

        .item02 {
            background-color: blue;
            grid-row-start: -3;
            grid-row-end: -1;
            grid-column-start: -3;
            grid-column-end: -1;
        }

        .item03 {
            background-color: green;
            grid-row-start: 2;
            grid-row-end: -3;
            grid-column-start: -3;
            grid-column-end: -1;
        }

        .item04 {
            background-color: orange;
            grid-row-start: 2;
            grid-row-end: 4;
            grid-column-start: 2;
            grid-column-end: 4;
        }
    </style>
</head>

<body>

    <div class="parent">
        <div class="child item01">1</div>
        <div class="child item02">2</div>
        <div class="child item03">3</div>
        <div class="child item04">4</div>
        <div class="child item05">5</div>
        <div class="child item06">6</div>
    </div>

</body>

</html>